-- CALC_SELECT_TARGET_DETIAL
-- 道具选择目标时的描述

return function(classId)
    local detial = ItemM.getItemDetail(classId);
    -- 几个特殊道具的情况
    local prop;
    local level = 0;

    local args = PropertyM.query(classId,  "args") or {};
    if (args.damage or args.addition_damage or args.area_damage or args.all_damage
        or args.vertical_damage or args.around_damage or args.soul_damage or args.forbid_magic_damage)
        and PropertyM.query(classId, "target") ~= PROPERTY_SELF then
        -- 道具伤害加成
        local damage = string.match(detial, "%d+");
        prop = PropM.combine(ME.user, "property_damage", 1);
        local addon = PropM.apply(prop, damage) - damage;
        if addon > 0 then
            local damageDesc = tostring(damage);
            damageDesc = damageDesc .. "(+" .. addon .. ")";
            detial = string.gsub(detial, tostring(damage), damageDesc, 1);
        end
    end

    -- 爆裂火箭弹
    if classId == 7212 then
        prop = PropM.combine(ME.user, "mechanics", 1);
        level = PropM.apply(prop, level);
        local damage = 30;
        local radius = 0;

        if level >= 1 then
            radius = radius + 1;
        end
        if level >= 2 then
            damage = damage + 30;
        end
        if level >= 3 then
            radius = radius + 1;
        end
        if level >= 4 then
            damage = damage + 60;
        end
        if level >= 5 then
            radius = radius + 1;
        end

        -- 道具伤害加成
        prop = PropM.combine(ME.user, "property_damage", 1);
        local addon = PropM.apply(prop, damage) - damage;
        local damageDesc = tostring(damage);
        if addon > 0 then
            damageDesc = damageDesc .. "(+" .. addon .. ")";
        end

        if radius == 0 then
            detial = string.format(getLocStr("property_detial_7212_1"), damageDesc);
        else
            detial = string.format(getLocStr("property_detial_7212_2"), radius, damageDesc);
        end
    end

    -- 核融飞弹
    if classId == 7213 then
        prop = PropM.combine(ME.user, "mechanics", 1);
        level = PropM.apply(prop, level);
        local damage = 50;

        if level >= 1 then
            damage = damage + 50;
        end
        if level >= 3 then
            damage = damage + 50;
        end
        if level >= 5 then
            damage = damage + 50;
        end

        -- 道具伤害加成
        prop = PropM.combine(ME.user, "property_damage", 1);
        local addon = PropM.apply(prop, damage) - damage;
        local damageDesc = tostring(damage);
        if addon > 0 then
            damageDesc = damageDesc .. "(+" .. addon .. ")";
        end

        detial = string.format(getLocStr("property_detial_7212_1"), damageDesc);
        if level >= 4 then
            detial = detial..getLocStr("property_detial_7213_2");
        end
        if level >= 2 then
            detial = detial..getLocStr("property_detial_7213_1");
        end
    end

    -- 蝙蝠镖
    if classId == 7220 then
        prop = PropM.combine(ME.user, "bat", 1);
        level = PropM.apply(prop, level);
        local damage = 50;

        if level >= 3 then
            damage = damage + 100;
        end

        -- 道具伤害加成
        prop = PropM.combine(ME.user, "property_damage", 1);
        local addon = PropM.apply(prop, damage) - damage;
        local damageDesc = tostring(damage);
        if addon > 0 then
            damageDesc = damageDesc .. "(+" .. addon .. ")";
        end

        detial = string.format(getLocStr("property_detial_7212_1"), damageDesc);
        if level >= 5 then
            detial = string.format(getLocStr("property_detial_7220_1"), damageDesc);
        end
        if level >= 1 then
            detial = detial..getLocStr("property_detial_7220_2");
        end
        if level >= 2 then
            detial = detial..getLocStr("property_detial_7220_3");
        end
        if level >= 4 then
            detial = detial..getLocStr("property_detial_7220_4");
        end
    end

    return detial;
end